Skip to main content

Q-1: Attempt the following (5 Marks)

Questions

a) List features of Android Operating System.
b) Define Android Virtual Devices (AVD).
c) List all attributes to develop a simple button.
d) List any four Android Layouts.


Answers

a) Features of Android Operating System

  1. Open Source: Android is based on Linux kernel and is open source
  2. Multi-tasking: Supports running multiple applications simultaneously
  3. Rich UI: Provides attractive and intuitive user interface
  4. Connectivity: Built-in support for WiFi, Bluetooth, 3G, 4G, 5G
  5. Storage: Uses SQLite database for data storage
  6. Media Support: Supports various audio, video, and image formats
  7. Messaging: SMS, MMS, and various messaging applications
  8. Web Browser: Built-in web browser based on WebKit engine
  9. Java Support: Applications are developed using Java programming language
  10. Security: Application sandbox for security
  11. Memory Management: Automatic memory management and garbage collection
  12. Multi-touch: Support for multi-touch screens

b) Android Virtual Devices (AVD)

Definition: Android Virtual Device (AVD) is an emulator configuration that lets you model an actual device by defining hardware and software options to be emulated by the Android Emulator.

Key Points:

  • Purpose: Used for testing Android applications without physical device
  • Configuration: Includes system image, hardware profile, and emulator options
  • Components:
    • Hardware profile (screen size, resolution, RAM, etc.)
    • System image (Android version, API level)
    • Storage options (SD card, internal storage)
  • Creation: Created using AVD Manager in Android Studio
  • Benefits:
    • Test on different screen sizes and resolutions
    • Test different Android versions
    • Debug applications easily
    • No need for physical devices during development

c) Attributes to develop a simple button

Common Button Attributes:

  1. android:id - Unique identifier for the button
  2. android:layout_width - Width of the button (wrap_content, match_parent, specific dp)
  3. android:layout_height - Height of the button
  4. android:text - Text displayed on the button
  5. android:textSize - Size of the text
  6. android:textColor - Color of the text
  7. android:background - Background color or drawable
  8. android:onClick - Method to call when button is clicked
  9. android:padding - Internal spacing
  10. android:margin - External spacing
  11. android:gravity - Text alignment within button
  12. android:enabled - Whether button is clickable
  13. android:visibility - Visibility of button (visible, invisible, gone)
  14. android:drawableLeft/Right/Top/Bottom - Add icons to button

Example:

<Button
android:id="@+id/myButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Click Me"
android:textSize="16sp"
android:textColor="#FFFFFF"
android:background="#2196F3"
android:onClick="buttonClick" />

d) Four Android Layouts

  1. LinearLayout

    • Arranges views in a single row or column
    • Uses orientation attribute (horizontal/vertical)
    • Simple and commonly used layout
  2. RelativeLayout

    • Positions views relative to each other or parent
    • Flexible positioning using relative attributes
    • Good for complex layouts with fewer nested views
  3. ConstraintLayout

    • Most flexible layout manager
    • Uses constraints to position views
    • Flat view hierarchy for better performance
    • Recommended for complex UIs
  4. FrameLayout

    • Simple layout holding single child view
    • Child views are drawn in stack (last added on top)
    • Used for fragments and simple containers

Other Common Layouts:

  • TableLayout: Arranges views in rows and columns
  • GridLayout: Arranges views in grid format
  • CoordinatorLayout: Advanced layout for material design
  • ScrollView: Provides scrolling functionality

← Back to Question Paper